package com.gitee.cnlongdb.basic.constant;

import java.nio.charset.Charset;
import java.text.SimpleDateFormat;
import java.util.regex.Pattern;

/**
 * 系统名称：LongDbConstant.java
 * 模块名称：
 * 模块描述：longdb - 常量数据类
 * 功能列表：
 * 模块作者：ZOUYONG
 * 开发时间：2018年12月5日 下午9:29:57
 * 模块路径：com.gitee.cnlongdb.basic.constant.LongDbConstant
 * 更新记录：
 */
public class LongDbConstant {
	
	// longdb - 数据库默认英文名称
	public static final String longdbName = "cnlongdb";
	// longdb - 数据库默认中文名称
	public static final String longdbDefaultName = "[中国龙cnlongdb]";
	
	// longdb - 配置文件的后缀
	public static final String longdbCfgSuffix = ".cfg";
	// longdb - 表分区配置文件的后缀
	public static final String longdbRuleSuffix = ".rule";
	
	// longdb - 数据库存放表的根目录名称
	public static final String longdbDataBaseHouse = "tableHouse";
	// longdb - 表存储数据的仓库目录名称
	public static final String longdbTableDataHouse = "dataHouse";

	// longdb - 数据库标识
	public static final String longdbDataBase = "dataBase";
	// longdb - 表名称
	public static final String longdbTableName = "tableName";
	// longdb - ID
	public static final String longdbTableLongId = "longId";
	// longdb - 序号
	public static final String longdbTableLongNumber = "longNumber";
	// longdb - 创建时间
	public static final String longdbTableCreateDate = "createDate";
	// longdb - 修改时间
	public static final String longdbTableUpdateDate = "updateDate";
	
	// longdb - 执行器-新增
	public static final String longdbActuatorInsert = "insertActuator";
	// longdb - 执行器-删除
	public static final String longdbActuatorRemove = "removeActuator";
	// longdb - 执行器-修改
	public static final String longdbActuatorUpdate = "updateActuator";
	// longdb - 执行器-插曲
	public static final String longdbActuatorQuery = "queryActuator";
	// longdb - 执行器-创建
	public static final String longdbActuatorCreate = "createActuator";
	
	// 换行符号
	public static final String longdbTableChangeLine = "\r\n";
	// longdb - 数据对象转义分隔符"&"
	public static final String longdbTableDataTranS = "\"&\"";
	// longdb - 数据对象转义分隔符":"
	public static final String longdbTableDataTranI = "\":\"";
	// longdb - 注释符号
	public static final String longdbTableDataTranA = ";";
	public static final String longdbTableDataTranB = "=";
	public static final String longdbTableDataTranD = "#";
	public static final String longdbTableDataTranE = "/";
	public static final String longdbTableDataTranF = ":";
	
	// longdb - 删除标识
	public static final String longdbDeleteFlag = "-delete";
	// longdb - 事务标识
	public static final String longdbTranscationFlag = "-transaction";
	// longdb - 主从数据同步标识
	public static final String longdbMasterSlaveSynsFlag = "-masterSlave";
	
	// longdb - 表分区配置-关联字段分区
	public static final String fieldMatching = "fieldMatching";
	// longdb - 表分区配置-时间分区
	public static final String dateTimeMatching = "dateTimeMatching";
	// longdb - 读取分离-读配置
	public static final String longdbReadConnect = "readLongdbConnect";
	// longdb - 读取分离-写配置
	public static final String longdbWriteConnect = "writeLongdbConnect";
	// longdb - 主从数据备份
	public static final String longdbSlaveDataBase = "longdbSlaveDataBase";
	
	// longdb - 系统编码集
	public static final String longdbSystemCharset = "utf-8";
	// 获取系统文件的编码集
	public static String encoding = System.getProperty("file.encoding");
	// 加载字节编码集
	public static Charset charset = Charset.forName(encoding);
	
	// longdb - 字符串分割对象
	public static final Pattern traniPattern = Pattern.compile(longdbTableDataTranI);
	public static final Pattern transPattern = Pattern.compile(longdbTableDataTranS);
	
	// 时间格式转换对象
	public static final String dataTimeYmd = "yyyy-MM-dd";
	public static final String dataTimeYmdHms = "yyyy-MM-dd HH:mm:ss";
	public static final SimpleDateFormat generFormatOne = new SimpleDateFormat(dataTimeYmdHms);
	public static final SimpleDateFormat generFormatTwo = new SimpleDateFormat("yyyyMMddHHmmss");
	public static final SimpleDateFormat generFormatThree = new SimpleDateFormat("yyyy-MMdd-HHmmss");
	public static final SimpleDateFormat generFormatFour = new SimpleDateFormat(dataTimeYmd);
	public static final SimpleDateFormat generFormatYear = new SimpleDateFormat("yyyy");
	
	// netty相关 - netty消息最大长度
	public static int cnlongNettyDataPackageLength = 10 * 1024;
	
	// 空文件，并且文件创建时间在1分钟后
	public static int deleteFileMaxCreateUpdateTime = 60 * 1000;
	
}
